package com.slot.faraohgold;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.RotateAnimation;
import android.view.animation.TranslateAnimation;

public class Reel extends View {
	private Bitmap[] reel_content = new Bitmap[]{BitmapFactory.decodeResource(getResources(), R.drawable.sim0),
			BitmapFactory.decodeResource(getResources(), R.drawable.sim1),
			BitmapFactory.decodeResource(getResources(), R.drawable.sim2),
			BitmapFactory.decodeResource(getResources(), R.drawable.sim3),
			BitmapFactory.decodeResource(getResources(), R.drawable.sim4),
			BitmapFactory.decodeResource(getResources(), R.drawable.sim5)};
	private Animation anim;
	
	public Reel(Context context) {
		super(context);
	}
	public void createAnim(Canvas canvas) {
		anim = new  AlphaAnimation(0, 1);
        anim.setRepeatMode(Animation.REVERSE);
        anim.setRepeatCount(Animation.INFINITE);
        anim.setDuration(1000L);
        startAnimation(anim);
    }
	@Override
	public void onDraw(Canvas canvas){
		super.onDraw(canvas);
		if (anim == null) createAnim(canvas);
		for(int i=0;i<6;i++){
			canvas.drawBitmap(reel_content[i],35,i*70,null);
		}
	}
}
